﻿using JESAI.Redis.Abstracts.Commands;
using JESAI.Redis.Datas;
using JESAI.Redis.Events;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace JESAI.Redis.Abstracts.Resolvers
{
    public interface IRedisResolver
    {
        #region Events

        /// <summary>
        /// 
        /// </summary>
        /// <param name="eventHandler"></param>
        void RegisterCommandExecuteEvent(EventHandler<CommandExecuteEventArgs> eventHandler);
        /// <summary>
        /// 注册命令拦截
        /// </summary>
        /// <param name="eventHandler"></param>
        void RegisterCommandExecutedEvent(EventHandler<CommandExecutedEventArgs> eventHandler);

        /// <summary>
        /// 取消注册拦截器
        /// </summary>
        void UnRegisterCommandExecuteEvent(EventHandler<CommandExecuteEventArgs> eventHandler);

        /// <summary>
        /// 取消注册拦截器
        /// </summary>
        void UnRegisterCommandExecutedEvent(EventHandler<CommandExecutedEventArgs> eventHandler);

        #endregion
        /// <summary>
        /// 执行
        /// </summary>
        public Task<RedisData> InvokeSimpleAsync(IRedisCommandArg commandArg);
    }
}
